package com.tianji.learning.service;

import com.tianji.common.domain.dto.PageDTO;
import com.tianji.common.domain.query.PageQuery;
import com.tianji.learning.domain.dto.LearningPlanDTO;
import com.tianji.learning.domain.po.LearningLesson;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tianji.learning.domain.vo.LearningLessonVO;
import com.tianji.learning.domain.vo.LearningPlanPageVO;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 学生课程表 服务类
 * </p>
 *
 * @author waker
 * @since 2025-10-18
 */
public interface ILearningLessonService extends IService<LearningLesson> {

    /**
     * 添加课程到用户课表
     * @param userId
     * @param courseIds
     */
    void addLessons(Long userId, List<Long> courseIds);

    /**
     * 分页查询我的课表
     * @param pageQuery
     * @return
     */
    PageDTO<LearningLessonVO> PageQueryMyLessons(PageQuery pageQuery);

    /**
     * 查询当前正在学习的课程
     * @return
     */
    LearningLessonVO queryMyCurrentLesson();

    /**
     * 用户删除课程
     * @param courseId
     */
    void deleteMyLesson(Long courseId);

    /**
     * 删除用户退款的课程
     * @param userId
     * @param aLong
     */
    void deleteRefundLesson(Long userId, List<Long> courseIds);

    /**
     * 检查课程是否有效
     * @param courseId
     * @return
     */
    Long isLessonValid(Long courseId);

    /**
     * 根据id查询用户课表中指定课程的状态
     * @param courseId
     * @return
     */
    LearningLessonVO getCourseStatusById(Long courseId);

    /**
     * 统计课程的学习人数
     * @param courseId
     * @return
     */
    Integer countLearningLessonByCourse(Long courseId);

    /**
     * 创建或修改学习计划
     * @param learningPlanDTO
     */
    void createPlans(LearningPlanDTO learningPlanDTO);

    /**
     * 分页查询我的学习计划
     * @param pageQuery
     * @return
     */
    LearningPlanPageVO queryMyPlans(PageQuery pageQuery);
}
